package day9;

public class Person /* extends Object */{
	protected int id;
	protected String name;
	protected int age;
	
	public void show() {
		System.out.println(toString());
		//System.out.println("id:" + id + ", name:" + name);
	}

	public Person() {
		// super()代表的是父类的无参构造方法
		// 这个可以不写，Java自动会给我们加上
		super();
		System.out.println("Person.Person() --1");
	}

	public Person(int id, String name, int age) {
		super();
		this.id = id;
		this.name = name;
		this.age = age;
		System.out.println("Person.Person() --2");
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	@Override
	public String toString() {
		return "Person [id=" + id + ", name=" + name + ", age=" + age + "]";
	}
	
}
